

log using "results.log", replace text
* Set workng directory
cd "/Users/melaniss/Library/Mobile Documents/com~apple~CloudDocs/Documents/Mannheim/Stolpersteine/Submission"



use Stolpersteine_a.dta, clear

* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ *
* ············································································ *
                             * PREPARE VARIABLES *                          
* ············································································ *
* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ *


* ··························  PRE-T SOCIODEMO  ······························· *
tab age, gen (age_)


* Non-binary individuals do not match pre-registered block randomization. These cases are dropped.
tab gender
drop if gender == 3

gen woman = 0
replace woman = 1 if gender == 2

* 1 religious, 2 agnostic, 3 atheist, 4 other
gen religious = 0
replace religious = 1 if religiosity == 1

/*Race/ethnicity
* Var "ethnicitysimplified" contains race/ethnicity pre-recorded values. 
* Var "raceminority" contains question as to whether respondent believes themselves to belong to the majority race in their country 
raceminority is renamed to avoid confusion. */

rename raceminority raceminoritymajority

tab ethnicitysimplified
gen ethnicminority = 0
replace ethnicminority = 1 if ethnicitysimplified == "Asian" | ///
ethnicitysimplified == "Black" | ethnicitysimplified == "Mixed" | ///
ethnicitysimplified == "Other" 
replace ethnicminority = . if ethnicitysimplified == "DATA_EXPIRED"
tab ethnicminority

gen white = 0
replace white = 1 if ethnicitysimplified == "White"



* Other types of minorities
* 1 = sexual minority
* 2 = disabled
* 3 = other type
* 4 = not a minority

* see if there is any ethnic minority that says 4

gen minority = 0
replace minority = 1 if ethnicminority == 1 | otherminority != "4"
tab minority

gen otherminoritydummy = 0
replace otherminoritydummy = 1 if otherminority != "4"

* Bundesland of birth *
label define land 1 "Baden-Württemberg" 2"Bayern" 3"Berlin" ///
4 "Brandenburg" ///
5 "Bremen" ///
6 "Hamburg" ///
7 "Hesse" ///
8 "Mecklenburg-Vorpommern" ///
9 "Niedersachsen" ///
10 "Nordrhein-Westfalen" ///
11 "Rheinland-Pfalz" ///
12 "Saarland" ///
13 "Sachsen" ///
14 "Sachsen-Anhalt" ///
15 "Schleswig-Holstein" ///
16 "Thüringen" 

label values state land 
tab state, gen (state_)



* generate dummy variables of pre-treatment sociodemo *
tab education, gen (edu_)
tab income, gen (income_)
tab polint, gen (polint_)





* ··················· TREATMENT, CONTROL & CHECKS ····························· *


* Create dummy for those who fail/don't answer the attention check
fre attention
gen failcheck = 0
replace failcheck = 1 if attention != "2,5"


* Raname treatment variables and generate treatment variable
rename timer_t_FirstClick treatfirstclick
rename timer_t_PageSubmit treatpagesubmit



destring treatfirstclick, replace


gen treatment = .
replace treatment = 1 if treatfirstclick != .
replace treatment = 0 if treatfirstclick == .




* ··················· Table 1 Appendix: Attention Check ····························· *

* Check if they are more likely to fail the attention check depending on 
* treatment status.
regr failcheck treatment, r
* NO RELATION


* ··························  OUTCOME VARIABLES ······························ *
* Original questionnaire in German in Appendix

* Emotion variables
rename emotions_1 anger 
rename emotions_2 joy
rename emotions_3 fear
rename emotions_4 pride
rename emotions_5 sadness
rename emotions_6 disgust 
rename emotions_7 hostility



* Coworkers 
rename minorities_1 disabled
rename minorities_2 jewish
rename minorities_3 asian
rename minorities_4 black
rename minorities_5 lgb
rename minorities_6 muslim
rename minorities_7 intersex
rename minorities_8 trans
rename minorities_9 roma
rename minorities_10 witness


* Refugees
rename refugees_1 refrights
rename refugees_2 refterror
rename refugees_3 refcrime
rename refugees_4 refmoney

* Inversion of variables indicate negative perceptions about refugees so they go in the same directon as refrights
gen refterror_inv = 6-refterror
tab refterror_inv refterror
gen refcrime_inv =  6 - refcrime
tab refcrime_inv refcrime
gen refmoney_inv = 6 - refmoney
tab refmoney_inv refmoney

* Democracy
tab democracy, gen (democracy_)

gen prodemo = 0
replace prodemo = 1 if democracy== 1


* Create varaiable for total donation *
*Var behavior: 1 keep100, 2donate x, 3donate100

*check  if there are any non numeric values in quantity.
tab behavior_2_TEXT

*n partial donors*
gen quantity = behavior_2_TEXT 

* behavior 1= keep 100, 2 give X, 3 give 100
replace quantity = 100 if behavior == 3
replace quantity = 0 if behavior == 1


*Dummy variable for whether respondent donated or not*
gen donationyn = 0
replace donationyn = 1 if quantity!= 0

tab  behavior donationyn
tab  quantity donationyn


* Vote intention
label define vote 1 "SPD" ///
2 "CDU/CSU" ///
3 "Die Grünen" /// 
4 "FDP" ///
5 "Die Linke" ///
6 "AfD" ///
7 "Andere Partei" ///
8 "Würde einen leeren Stimmzettel abgeben" /// 
9 "Würde den Stimmzettel ungültig machen" ///
10 "Würde keine Stimme abgeben" ///
11 "Weiß nicht"  

label values vote vote 

tab vote, gen (vote_)

save stones.dta, replace





* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ *
* ············································································ *
                    * Figure B1 Appendix: T&C PRE-T BALANCE *                          
* ············································································ *
* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ *


* Load your main data
use stones.dta, clear

* Define covariates
local covars woman age_1 age_2 age_3 age_4 age_5 age_6 religious otherminoritydummy ethnicminority raceminoritymajority ///
    ideoscale state_1 state_2 state_3 state_4 state_5 state_6 polint_1 polint_2 polint_3 polint_4 ///
    income_1 income_2 income_3 income_4 income_5 income_6 income_7 ///
    edu_2 edu_3 edu_4 edu_5 edu_6 ///
    state_7 state_8 state_9 state_10 state_11 state_12 state_13 state_14 state_15 state_16 failcheck

* First regression: create (replace) file
local first = 1

foreach covar of local covars {
    
    regress `covar' treatment, r

    if `first' {
        regsave treatment using covariate_test.dta, ci pval tstat level(95) replace addlabel(Covariate, `covar')
        local first = 0
    }
    else {
        regsave treatment using covariate_test.dta, ci pval tstat level(95) append addlabel(Covariate, `covar')
    }
}



save stones.dta, replace
 

* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ *
* ············································································ *
							* MAIN ANALYSES *                          
* ············································································ *
* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ *

use stones.dta, clear




* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ *
* ·····  Table 1: Coworker Means ···································· *
* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ *


clear
gen variable = .
save coworkers_means.dta, replace
use stones.dta, clear



local coworkers disabled jewish asian black lgb muslim intersex trans roma witness 
foreach coworker in `coworkers'{
	mean `coworker'	
	regsave `coworker' using "coworkers_means.dta", ci pval tstat level(95) append addlabel (Group, all)
}

local coworkers disabled jewish asian black lgb muslim intersex trans roma witness 
foreach coworker in `coworkers'{
	mean `coworker' if treatment == 0
	regsave `coworker' using "coworkers_means.dta", ci pval tstat level(95) append addlabel (Group, control)
}

local coworkers disabled jewish asian black lgb muslim intersex trans roma witness 
foreach coworker in `coworkers'{
	mean `coworker' if treatment == 1
	regsave `coworker' using "coworkers_means.dta", ci pval tstat level(95) append addlabel (Group, treatment)

}

save stones.dta, replace

use coworkers_means.dta, clear
drop variable


* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ *
* ····· Table 1: unstandardized ATE ···································· *
* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ *
clear
gen variable = .
save coworkers.dta, replace
use stones.dta, clear



* Local with all variables
local coworkers disabled jewish asian black lgb muslim intersex trans roma witness
foreach coworker in `coworkers'{
	regr `coworker' treatment, r
	regsave treatment using "coworkers.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0)
}



save stones.dta, replace


use coworkers.dta, clear
drop variable

gen var2 = .
replace var2 = 1 if Var== "disabled"
replace var2 = 2 if Var== "jewish"
replace var2 = 3 if Var== "asian"
replace var2 = 4 if Var== "black"
replace var2 = 5 if Var== "lgb"
replace var2 = 6 if Var== "muslim"
replace var2 = 7 if Var== "intersex"
replace var2 = 8 if Var== "trans"
replace var2 = 9 if Var== "roma"
replace var2 = 10 if Var== "witness"

tab var2

save coworkers.dta, replace





* ··························  Table 3 Appendix ······························· *


* T- Test Jehova's Witness vs else *

clear
gen variable = .
save jehovas.dta, replace
use stones.dta, clear

putexcel set "jehovas.xlsx",  replace
local minorities disabled jewish asian black lgb muslim intersex trans roma
estimates clear
local row = 2
foreach minority in `minorities'{
	ttest `minority' == witness if treatment == 0
	putexcel A`row'=("`minority'")
	putexcel B`row'= (r(t))
	putexcel C`row'= (r(mu_1) - r(mu_2))
	local ++row
	
}
 




* ····················  Figure 2 and Figure D2 in Appendix ······················· *
use stones.dta, clear

pca  disabled jewish asian black lgb muslim intersex trans roma witness 
predict c1 c2 c3 c4 c5 c6 c7 c8 c9 c10, score

pca refrights refterror_inv refcrime_inv refmoney_inv
predict r1 r2 r3 r4, score


save stones.dta, replace

* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ ALL VARIABLES STD ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞*
clear
gen variable = .
save allvar.dta, replace
use stones.dta, clear


* Standardize variables

foreach var of varlist anger joy fear pride sadness disgust hostility ///
disabled jewish asian black lgb muslim intersex trans roma witness c1 ///
refrights refterror_inv refcrime_inv refmoney_inv r1 prodemo  quantity donationyn {
egen std`var' = std(`var')
}
 save stones.dta, replace


*emotions std
local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment, r
	regsave treatment using "allvar.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1)
}

local covar woman age_1 age_2 age_3 age_4 age_5 age_6 religious otherminoritydummy ethnicminority raceminoritymajority     ///
ideoscale state_1 state_2 state_3 state_4 state_5 state_6 polint_1 polint_2 /// 
polint_3 polint_4 income_1 income_2 income_3 income_4 income_5 income_6 income_7  ///
edu_2 edu_3 edu_4 edu_5 edu_6 state_1 state_2 state_3 state_4 state_5 state_6 ///
state_7 state_8 state_9 state_10 state_11 state_12 state_13 state_14 state_15 state_16 failcheck
local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment `covar', r
	regsave treatment using "allvar.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 1, Facet, 1)
}




* coworkers std
local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker' treatment, r
	regsave treatment using "allvar.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2)
}


local covar woman age_1 age_2 age_3 age_4 age_5 age_6 religious otherminoritydummy ethnicminority raceminoritymajority  ///
ideoscale state_1 state_2 state_3 state_4 state_5 state_6 polint_1 polint_2 /// 
polint_3 polint_4 income_1 income_2 income_3 income_4 income_5 income_6 income_7  ///
edu_2 edu_3 edu_4 edu_5 edu_6 state_1 state_2 state_3 state_4 state_5 state_6 ///
state_7 state_8 state_9 state_10 state_11 state_12 state_13 state_14 state_15 state_16 failcheck
local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker' treatment `covar', r
	regsave treatment using "allvar.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 1, Facet, 2)
}



* refugees std
local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment, r
	regsave treatment using "allvar.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3)
}

local covar woman age_1 age_2 age_3 age_4 age_5 age_6 religious otherminoritydummy ethnicminority raceminoritymajority   ///
ideoscale state_1 state_2 state_3 state_4 state_5 state_6 polint_1 polint_2 /// 
polint_3 polint_4 income_1 income_2 income_3 income_4 income_5 income_6 income_7  ///
edu_2 edu_3 edu_4 edu_5 edu_6 state_1 state_2 state_3 state_4 state_5 state_6 ///
state_7 state_8 state_9 state_10 state_11 state_12 state_13 state_14 state_15 state_16 failcheck
local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment `covar', r
	regsave treatment using "allvar.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 1, Facet, 3)
}


* demo std
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment, r
	regsave treatment using "allvar.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4)
}




local covar woman age_1 age_2 age_3 age_4 age_5 age_6 religious otherminoritydummy ethnicminority raceminoritymajority   ///
ideoscale state_1 state_2 state_3 state_4 state_5 state_6 polint_1 polint_2 /// 
polint_3 polint_4 income_1 income_2 income_3 income_4 income_5 income_6 income_7  ///
edu_2 edu_3 edu_4 edu_5 edu_6 state_1 state_2 state_3 state_4 state_5 state_6 ///
state_7 state_8 state_9 state_10 state_11 state_12 state_13 state_14 state_15 state_16 failcheck
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment `covar', r
	regsave treatment using "allvar.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 1, Facet, 4)
}



save stones.dta, replace

use allvar.dta, clear
drop variable
gen var2 = .
replace var2 = 1 if Var== "stdjoy"
replace var2 = 2 if Var== "stdpride"
replace var2 = 3 if Var== "stdsadness"
replace var2 = 4 if Var== "stdhostility"
replace var2 = 5 if Var== "stdfear"
replace var2 = 6 if Var== "stddisgust"
replace var2 = 7 if Var== "stdanger"
replace var2 = 8 if Var== "stddisabled"
replace var2 = 9 if Var== "stdjewish"
replace var2 = 10 if Var== "stdasian"
replace var2 = 11 if Var== "stdblack"
replace var2 = 12 if Var== "stdlgb"
replace var2 = 13 if Var== "stdmuslim"
replace var2 = 14 if Var== "stdintersex"
replace var2 = 15 if Var== "stdtrans"
replace var2 = 16 if Var== "stdroma"
replace var2 = 17 if Var== "stdwitness"
replace var2 = 18 if Var== "stdc1"
replace var2 = 19 if Var== "stdrefrights"
replace var2 = 20 if Var== "stdrefterror_inv"
replace var2 = 21 if Var== "stdrefcrime_inv"
replace var2 = 22 if Var== "stdrefmoney_inv"
replace var2 = 23 if Var== "stdr1"
replace var2 = 24 if Var== "stdprodemo"
replace var2 = 25 if Var== "stddonationyn"
replace var2 = 26 if Var== "stdquantity"
tab var2

save allvar.dta, replace

use stones.dta, clear

* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ *
* ········  Figure 3 and 4: Heterogeneous Treatment Effects  ················· *
* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ *

* Political Interest *
* generate variable for high and low political interest * 

gen hlpolint = .
replace hlpolint = 0 if polint == 1 | polint == 2 
replace hlpolint = 1 if polint == 3 | polint == 4
gen treat_hlpolint = treatment * hlpolint

* reference category is high

save stones.dta, replace

clear
gen variable = .
save hte_hlpolint.dta, replace
use stones.dta, clear


*emotions std
local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment hlpolint treat_hlpolint, r
	regsave treat_hlpolint using "hte_hlpolint.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 0, Facet2, 2)
}

local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment if hlpolint == 1 , r
	regsave treatment using "hte_hlpolint.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 1, Facet2, 1)
}

local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment if hlpolint == 0, r
	regsave treatment using "hte_hlpolint.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 2, Facet2, 1)
}




* coworkers std
local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker' treatment hlpolint treat_hlpolint, r
	regsave treat_hlpolint using "hte_hlpolint.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 0, Facet2, 2)
}
local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker' treatment if hlpolint == 1, r
	regsave treatment using "hte_hlpolint.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 1, Facet2, 1)
}

local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker' treatment if hlpolint == 0, r
	regsave treatment using "hte_hlpolint.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 2, Facet2, 1)
}



* refugees std
local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment hlpolint treat_hlpolint, r
	regsave treat_hlpolint  using "hte_hlpolint.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 0, Facet2, 2)
}
local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment if hlpolint == 1, r
	regsave treatment  using "hte_hlpolint.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 1, Facet2, 1)
}

local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment if hlpolint == 0, r
	regsave treatment  using "hte_hlpolint.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 2, Facet2, 1)
}



* demo std
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment hlpolint treat_hlpolint, r
	regsave treat_hlpolint  using "hte_hlpolint.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 0, Facet2, 2)
}
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment if hlpolint == 1, r
	regsave treatment  using "hte_hlpolint.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 1, Facet2, 1)
}
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment if hlpolint == 0, r
	regsave treatment  using "hte_hlpolint.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 2, Facet2, 1)
}


use hte_hlpolint.dta, clear
drop variable

gen var2 = .
replace var2 = 1 if Var== "stdjoy"
replace var2 = 2 if Var== "stdpride"
replace var2 = 3 if Var== "stdsadness"
replace var2 = 4 if Var== "stdhostility"
replace var2 = 5 if Var== "stdfear"
replace var2 = 6 if Var== "stddisgust"
replace var2 = 7 if Var== "stdanger"
replace var2 = 8 if Var== "stddisabled"
replace var2 = 9 if Var== "stdjewish"
replace var2 = 10 if Var== "stdasian"
replace var2 = 11 if Var== "stdblack"
replace var2 = 12 if Var== "stdlgb"
replace var2 = 13 if Var== "stdmuslim"
replace var2 = 14 if Var== "stdintersex"
replace var2 = 15 if Var== "stdtrans"
replace var2 = 16 if Var== "stdroma"
replace var2 = 17 if Var== "stdwitness"
replace var2 = 18 if Var== "stdc1"
replace var2 = 19 if Var== "stdrefrights"
replace var2 = 20 if Var== "stdrefterror_inv"
replace var2 = 21 if Var== "stdrefcrime_inv"
replace var2 = 22 if Var== "stdrefmoney_inv"
replace var2 = 23 if Var== "stdr1"
replace var2 = 24 if Var== "stdprodemo"
replace var2 = 25 if Var== "stddonationyn"
replace var2 = 26 if Var== "stdquantity"
tab var2


save hte_hlpolint.dta, replace


use stones.dta, clear



* ································  Figure 4 ································· *
* Ideology left-right

clear
gen variable = .
save hte_leftright.dta, replace
use stones.dta, clear

gen leftright = .
replace leftright = 0 if ideoscale < 5
replace leftright = 1 if ideoscale > 5

* Reference category is left.


*emotions std
local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment##leftright , r
	regsave 1.treatment#1.leftright using "hte_leftright.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 0, Facet2, 2)
}
local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment if leftright==1, r
	regsave treatment using "hte_leftright.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 1, Facet2, 1)
}
local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment if leftright==0 , r
	regsave treatment using "hte_leftright.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 2, Facet2, 1)
}




* coworkers std
local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker' treatment##leftright  , r
	regsave 1.treatment#1.leftright using "hte_leftright.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 0, Facet2, 2)
}
local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker' treatment if leftright==1, r
	regsave treatment using "hte_leftright.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 1, Facet2, 1)
}
local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker' treatment if leftright==0, r
	regsave treatment using "hte_leftright.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 2, Facet2, 1)
}



* refugees std
local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment##leftright  , r
	regsave 1.treatment#1.leftright using "hte_leftright.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 0, Facet2, 2)
}
local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment if leftright==1 , r
	regsave treatment using "hte_leftright.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 1, Facet2, 1)
}
local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment if leftright==0, r
	regsave treatment using "hte_leftright.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 2, Facet2, 1)
}



* demo std
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment##leftright  , r
	regsave 1.treatment#1.leftright using "hte_leftright.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 0, Facet2, 2)
}
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment if leftright==1 , r
	regsave treatment using "hte_leftright.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 1, Facet2, 1)
}
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment if leftright==0 , r
	regsave treatment using "hte_leftright.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 2, Facet2, 1)
}




use hte_leftright.dta, clear
drop variable

gen var2 = .
replace var2 = 1 if Var== "stdjoy"
replace var2 = 2 if Var== "stdpride"
replace var2 = 3 if Var== "stdsadness"
replace var2 = 4 if Var== "stdhostility"
replace var2 = 5 if Var== "stdfear"
replace var2 = 6 if Var== "stddisgust"
replace var2 = 7 if Var== "stdanger"
replace var2 = 8 if Var== "stddisabled"
replace var2 = 9 if Var== "stdjewish"
replace var2 = 10 if Var== "stdasian"
replace var2 = 11 if Var== "stdblack"
replace var2 = 12 if Var== "stdlgb"
replace var2 = 13 if Var== "stdmuslim"
replace var2 = 14 if Var== "stdintersex"
replace var2 = 15 if Var== "stdtrans"
replace var2 = 16 if Var== "stdroma"
replace var2 = 17 if Var== "stdwitness"
replace var2 = 18 if Var== "stdc1"
replace var2 = 19 if Var== "stdrefrights"
replace var2 = 20 if Var== "stdrefterror_inv"
replace var2 = 21 if Var== "stdrefcrime_inv"
replace var2 = 22 if Var== "stdrefmoney_inv"
replace var2 = 23 if Var== "stdr1"
replace var2 = 24 if Var== "stdprodemo"
replace var2 = 25 if Var== "stddonationyn"
replace var2 = 26 if Var== "stdquantity"
tab var2


save hte_leftright.dta, replace




* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ *
* ········  Figures E3 to E9 in Appendix  ················· *
* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ *


* ················  Figure E.3 to E.6  Age ····································· *


use stones.dta, clear
recode age (1 = 1) (2 = 2) (3 = 3) (4 = 4) (5 = 5) (6 = 5), gen (age_recoded)
tab age age_recoded

tab age_recoded, gen(recode_age_)

forvalues x = 1/5{
gen treat_age_`x'  = treatment * recode_age_`x'
}

save stones.dta, replace

clear
gen variable = .
save hte_age.dta, replace
use stones.dta, clear


*emotions std
local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment recode_age_2 recode_age_3 recode_age_4 recode_age_5 treat_age_2 treat_age_3 treat_age_4 treat_age_5, r
	regsave treat_age_2 treat_age_3 treat_age_4 treat_age_5 using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 0, Facet2, 2)
}


local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment if recode_age_1 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 1, Facet2, 1)
}


local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment if recode_age_2 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 2, Facet2, 1)
}

local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment if recode_age_3 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 3, Facet2, 1)
}


local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment if recode_age_4 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 4, Facet2, 1)
}

local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment if recode_age_5 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 5, Facet2, 1)
}



* coworkers std
local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker' treatment recode_age_2 recode_age_3 recode_age_4 recode_age_5 treat_age_2 treat_age_3 treat_age_4 treat_age_5, r
	regsave treat_age_2 treat_age_3 treat_age_4 treat_age_5 using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 0, Facet2, 2)
}

local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker'  treatment if recode_age_1 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 1, Facet2, 1)
}

local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker'  treatment if recode_age_2 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 2, Facet2, 1)
}

local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker'  treatment if recode_age_3 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 3, Facet2, 1)
}

local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker'  treatment if recode_age_4 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 4, Facet2, 1)
}

local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker'  treatment if recode_age_5 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 5, Facet2, 1)
}



* refugees std
local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment recode_age_2 recode_age_3 recode_age_4 recode_age_5 treat_age_2 treat_age_3 treat_age_4 treat_age_5, r
	regsave treat_age_2 treat_age_3 treat_age_4 treat_age_5 using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 0, Facet2, 2)
}
local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment if recode_age_1 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 1, Facet2, 1)
}
local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment if recode_age_2 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 2, Facet2, 1)
}
local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment if recode_age_3 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 3, Facet2, 1)
}
local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment if recode_age_4 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 4, Facet2, 1)
}
local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment if recode_age_5 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 5, Facet2, 1)
}





* demo std
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment recode_age_2 recode_age_3 recode_age_4 recode_age_5 treat_age_2 treat_age_3 treat_age_4 treat_age_5, r
	regsave treat_age_2 treat_age_3 treat_age_4 treat_age_5 using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 0, Facet2, 2)
}
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment if recode_age_1 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 1, Facet2, 1)
}
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment if recode_age_2 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 2, Facet2, 1)
}
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment if recode_age_3 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 3, Facet2, 1)
}
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment if recode_age_4 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 4, Facet2, 1)
}
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment if recode_age_5 == 1, r
	regsave treatment using "hte_age.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 5, Facet2, 1)
}





use hte_age.dta, clear
drop variable

gen var2 = .
replace var2 = 1 if Var== "stdjoy"
replace var2 = 2 if Var== "stdpride"
replace var2 = 3 if Var== "stdsadness"
replace var2 = 4 if Var== "stdhostility"
replace var2 = 5 if Var== "stdfear"
replace var2 = 6 if Var== "stddisgust"
replace var2 = 7 if Var== "stdanger"
replace var2 = 8 if Var== "stddisabled"
replace var2 = 9 if Var== "stdjewish"
replace var2 = 10 if Var== "stdasian"
replace var2 = 11 if Var== "stdblack"
replace var2 = 12 if Var== "stdlgb"
replace var2 = 13 if Var== "stdmuslim"
replace var2 = 14 if Var== "stdintersex"
replace var2 = 15 if Var== "stdtrans"
replace var2 = 16 if Var== "stdroma"
replace var2 = 17 if Var== "stdwitness"
replace var2 = 18 if Var== "stdc1"
replace var2 = 19 if Var== "stdrefrights"
replace var2 = 20 if Var== "stdrefterror_inv"
replace var2 = 21 if Var== "stdrefcrime_inv"
replace var2 = 22 if Var== "stdrefmoney_inv"
replace var2 = 23 if Var== "stdr1"
replace var2 = 24 if Var== "stdprodemo"
replace var2 = 25 if Var== "stddonationyn"
replace var2 = 26 if Var== "stdquantity"
tab var2


save hte_age.dta, replace


use stones.dta, clear


* ················  Figure E.7 Gender ····································· * 


use stones.dta, clear
gen woman_treat = treatment * woman
gen men = 0
replace men = 1 if gender == 1
gen man_treat = treatment * men
save stones.dta, replace

clear
gen variable = .
save hte_gender.dta, replace
use stones.dta, clear


*emotions std
local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment woman woman_treat, r
	regsave woman_treat using "hte_gender.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 0, Facet2, 2)
}

local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment if woman == 1, r
	regsave treatment using "hte_gender.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 1, Facet2, 1)
}

local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment if woman == 0, r
	regsave treatment using "hte_gender.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 2, Facet2, 1)
}





* coworkers std
local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker' treatment woman woman_treat, r
	regsave  woman_treat using "hte_gender.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 0, Facet2, 2)
}
foreach coworker in `coworkers'{
	regr `coworker' treatment if woman == 1, r
	regsave  treatment using "hte_gender.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 1, Facet2, 1)
}

foreach coworker in `coworkers'{
	regr `coworker' treatment if woman == 0, r
	regsave  treatment using "hte_gender.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 2, Facet2, 1)
}


* refugees std
local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment woman woman_treat, r
	regsave  woman_treat using "hte_gender.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 0, Facet2, 2)
}

local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment if woman == 1, r
	regsave  treatment using "hte_gender.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 1, Facet2, 1)
}

local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment if woman == 0, r
	regsave  treatment using "hte_gender.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 2, Facet2, 1)
}



* demo std
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment woman woman_treat, r
	regsave  woman_treat using "hte_gender.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 0, Facet2, 2)
}

local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment if woman == 1, r
	regsave  treatment using "hte_gender.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 1, Facet2, 1)
}
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment if woman == 0, r
	regsave  treatment using "hte_gender.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 2, Facet2, 1)
}




use hte_gender.dta, clear
drop variable

gen var2 = .
replace var2 = 1 if Var== "stdjoy"
replace var2 = 2 if Var== "stdpride"
replace var2 = 3 if Var== "stdsadness"
replace var2 = 4 if Var== "stdhostility"
replace var2 = 5 if Var== "stdfear"
replace var2 = 6 if Var== "stddisgust"
replace var2 = 7 if Var== "stdanger"
replace var2 = 8 if Var== "stddisabled"
replace var2 = 9 if Var== "stdjewish"
replace var2 = 10 if Var== "stdasian"
replace var2 = 11 if Var== "stdblack"
replace var2 = 12 if Var== "stdlgb"
replace var2 = 13 if Var== "stdmuslim"
replace var2 = 14 if Var== "stdintersex"
replace var2 = 15 if Var== "stdtrans"
replace var2 = 16 if Var== "stdroma"
replace var2 = 17 if Var== "stdwitness"
replace var2 = 18 if Var== "stdc1"
replace var2 = 19 if Var== "stdrefrights"
replace var2 = 20 if Var== "stdrefterror_inv"
replace var2 = 21 if Var== "stdrefcrime_inv"
replace var2 = 22 if Var== "stdrefmoney_inv"
replace var2 = 23 if Var== "stdr1"
replace var2 = 24 if Var== "stdprodemo"
replace var2 = 25 if Var== "stddonationyn"
replace var2 = 26 if Var== "stdquantity"
tab var2


save hte_gender.dta, replace



* ················  Figure E.8 Education ····································· * 
use stones.dta, clear
gen college = 0
replace college = 1 if education == 4 | education == 6 | education == 7
gen college_treat = treatment * college
*reference category is not college education.
save stones.dta, replace

clear
gen variable = .
save hte_college.dta, replace
use stones.dta, clear


*emotions std
local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment college college_treat, r
	regsave college_treat using "hte_college.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 0, Facet2, 2)
}

local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment if college == 1, r
	regsave treatment using "hte_college.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 1, Facet2, 1)
}

local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment if college == 0, r
	regsave treatment using "hte_college.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 2, Facet2, 1)
}





* coworkers std
local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker' treatment college college_treat, r
	regsave  college_treat using "hte_college.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 0, Facet2, 2)
}
foreach coworker in `coworkers'{
	regr `coworker' treatment if college == 1, r
	regsave  treatment using "hte_college.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 1, Facet2, 1)
}

foreach coworker in `coworkers'{
	regr `coworker' treatment if college == 0, r
	regsave  treatment using "hte_college.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 2, Facet2, 1)
}


* refugees std
local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment college college_treat, r
	regsave  college_treat using "hte_college.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 0, Facet2, 2)
}

local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment if college == 1, r
	regsave  treatment using "hte_college.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 1, Facet2, 1)
}

local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment if college == 0, r
	regsave  treatment using "hte_college.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 2, Facet2, 1)
}



* demo std
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment college college_treat, r
	regsave  college_treat using "hte_college.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 0, Facet2, 2)
}

local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment if college == 1, r
	regsave  treatment using "hte_college.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 1, Facet2, 1)
}
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment if college == 0, r
	regsave  treatment using "hte_college.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 2, Facet2, 1)
}




use hte_college.dta, clear
drop variable

gen var2 = .
replace var2 = 1 if Var== "stdjoy"
replace var2 = 2 if Var== "stdpride"
replace var2 = 3 if Var== "stdsadness"
replace var2 = 4 if Var== "stdhostility"
replace var2 = 5 if Var== "stdfear"
replace var2 = 6 if Var== "stddisgust"
replace var2 = 7 if Var== "stdanger"
replace var2 = 8 if Var== "stddisabled"
replace var2 = 9 if Var== "stdjewish"
replace var2 = 10 if Var== "stdasian"
replace var2 = 11 if Var== "stdblack"
replace var2 = 12 if Var== "stdlgb"
replace var2 = 13 if Var== "stdmuslim"
replace var2 = 14 if Var== "stdintersex"
replace var2 = 15 if Var== "stdtrans"
replace var2 = 16 if Var== "stdroma"
replace var2 = 17 if Var== "stdwitness"
replace var2 = 18 if Var== "stdc1"
replace var2 = 19 if Var== "stdrefrights"
replace var2 = 20 if Var== "stdrefterror_inv"
replace var2 = 21 if Var== "stdrefcrime_inv"
replace var2 = 22 if Var== "stdrefmoney_inv"
replace var2 = 23 if Var== "stdr1"
replace var2 = 24 if Var== "stdprodemo"
replace var2 = 25 if Var== "stddonationyn"
replace var2 = 26 if Var== "stdquantity"
tab var2


save hte_college.dta, replace





* ················  Figure E.9 Religion ····································· * 


clear
gen variable = .
save hte_religious.dta, replace
use stones.dta, clear





*emotions std
local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment##religious , r
	regsave 1.treatment#1.religious using "hte_religious.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 0, Facet2, 2)
}
local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment if religious==1, r
	regsave treatment using "hte_religious.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 1, Facet2, 1)
}
local emotions stdanger stdjoy stdfear stdpride stdsadness stddisgust stdhostility   
foreach emotion in `emotions'{
	regr `emotion' treatment if religious==0 , r
	regsave treatment using "hte_religious.dta", ci pval tstat level(95) append addlabel (Var, `emotion', Level, 95, Model, 1, Controls, 0, Facet, 1, Group, 2, Facet2, 1)
}




* coworkers std
local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker' treatment##religious  , r
	regsave 1.treatment#1.religious  using "hte_religious.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 0, Facet2, 2)
}
local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker' treatment if religious==1, r
	regsave treatment using "hte_religious.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 1, Facet2, 1)
}
local coworkers stddisabled stdjewish stdasian stdblack stdlgb stdmuslim stdintersex stdtrans stdroma stdwitness  stdc1
foreach coworker in `coworkers'{
	regr `coworker' treatment if religious==0, r
	regsave treatment using "hte_religious.dta", ci pval tstat level(95) append addlabel (Var, `coworker', Level, 95, Model, 1, Controls, 0, Facet, 2, Group, 2, Facet2, 1)
}



* refugees std
local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment##religious  , r
	regsave 1.treatment#1.religious using "hte_religious.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 0, Facet2, 2)
}
local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment if religious==1 , r
	regsave treatment using "hte_religious.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 1, Facet2, 1)
}
local refugees stdrefrights stdrefterror_inv stdrefcrime_inv stdrefmoney_inv stdr1
foreach refugee in `refugees'{
	regr `refugee' treatment if religious==0, r
	regsave treatment using "hte_religious.dta", ci pval tstat level(95) append addlabel (Var, `refugee', Level, 95, Model, 1, Controls, 0, Facet, 3, Group, 2, Facet2, 1)
}



* demo std
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment##religious   , r
	regsave 1.treatment#1.religious using "hte_religious.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 0, Facet2, 2)
}
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment if religious==1 , r
	regsave treatment using "hte_religious.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 1, Facet2, 1)
}
local demos stdprodemo stdquantity stddonationyn
foreach demo in `demos'{
	regr `demo' treatment if religious==0 , r
	regsave treatment using "hte_religious.dta", ci pval tstat level(95) append addlabel (Var, `demo', Level, 95, Model, 1, Controls, 0, Facet, 4, Group, 2, Facet2, 1)
}




use hte_religious.dta, clear
drop variable

gen var2 = .
replace var2 = 1 if Var== "stdjoy"
replace var2 = 2 if Var== "stdpride"
replace var2 = 3 if Var== "stdsadness"
replace var2 = 4 if Var== "stdhostility"
replace var2 = 5 if Var== "stdfear"
replace var2 = 6 if Var== "stddisgust"
replace var2 = 7 if Var== "stdanger"
replace var2 = 8 if Var== "stddisabled"
replace var2 = 9 if Var== "stdjewish"
replace var2 = 10 if Var== "stdasian"
replace var2 = 11 if Var== "stdblack"
replace var2 = 12 if Var== "stdlgb"
replace var2 = 13 if Var== "stdmuslim"
replace var2 = 14 if Var== "stdintersex"
replace var2 = 15 if Var== "stdtrans"
replace var2 = 16 if Var== "stdroma"
replace var2 = 17 if Var== "stdwitness"
replace var2 = 18 if Var== "stdc1"
replace var2 = 19 if Var== "stdrefrights"
replace var2 = 20 if Var== "stdrefterror_inv"
replace var2 = 21 if Var== "stdrefcrime_inv"
replace var2 = 22 if Var== "stdrefmoney_inv"
replace var2 = 23 if Var== "stdr1"
replace var2 = 24 if Var== "stdprodemo"
replace var2 = 25 if Var== "stddonationyn"
replace var2 = 26 if Var== "stdquantity"
tab var2


save hte_religious.dta, replace


* ··························  Table 2 Appendix ······························· *

* Coefficient and p-value : code for Figure 2
* Bonferroni's alpha's : manually calculated 



* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ *
* ··························   DESCRIPTIVES  ································· *
* ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ *
use stones.dta, clear
fre age gender religiosity state raceminoritymajority ethnicitysimplified education income ideoscale






log close
